<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<%@include file="style.jsp" %>
    <%@include file="script.jsp" %>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/orderlang/distributor/css/notice_list.css"/>
    <title>公告列表</title>
</head>
<body onselectstart="return false">
	<div id="container_1" style="height:100%">
	    <div style="position: relative">
	        <%@include file="header.jsp" %>
	    </div>
	    <div id="content" class="clearfix">
	        <%@include file="left_menu.jsp" %>
	        <!--内容部分-->
	        <div class="right-content" style="margin:75px 50px 0 213px;">
	            <p class="brand">
	                <a>客户</a>><a>公告</a>><a class="now">公告列表</a>
	            </p>
	            <div class="content">
	                <div class="top-block">
	                    <div class="block-btn">新增公告</div>
	                </div>
	                <div class="notice-list">
	                    <table>
	                        <thead>
		                        <tr>
		                            <td></td>
		                            <td>标题</td>
		                            <td>发布时间</td>
		                            <td>公告内容</td>
		                            <td></td>
		                        </tr>
	                        </thead>
	                        <tbody>
	                        	<c:forEach items="${distributorNoticeList}" var="dnList" varStatus="i">
		                            <tr>
		                                <td>${i.index+1}</td>
		                                <td>${dnList.title}</td>
		                                <td><fmt:formatDate value="${dnList.createTime}" pattern="yyyy-MM-dd hh:mm"/></td>
		                                <td>${dnList.content}</td>
		                                <td>
		                                    <button class="revise"><a onclick="gotoUpdate(${dnList.id})">修改</a></button>
		                                    <button class="delete"><a href="${pageContext.request.contextPath}/distributorNotice/deleteDistributorNotice?id=${dnList.id}">删除</a></button>
		                                </td>
		                            </tr>
	                            </c:forEach>
	                            
	                        </tbody>
	                    </table>
	                </div>
	                <div class="add-notice hide"> 
	                    <form action="${pageContext.request.contextPath}/distributorNotice/insertOrUpdateDistributorNotice" method="post" enctype="multipart/form-data" onsubmit="return check()">
	                        <h3 class="hide" id="insert">新增公告</h3>
	                        <h3 class="hide" id="update">修改公告</h3>
	                        <div class="input-block">
	                            <span style="vertical-align: middle"><i style="margin-top: 15px">*</i>公告标题</span>
	                            <input type="text" name="title" id="title" placeholder="请输入商品名称/条形码/关键字"/>
	                            <input type="hidden" name="id" id="id">
	                        </div>
	                        <div class="input-block" style="margin-top: 20px">
	                            <span><i>*</i>公告内容</span>
	                            <div class="text">
	                                <script id="goods_property" name="goods_property" type="text/plain"
	                                        style="width: 100%;height:300px;">
                                		<#if goods.goodsProperty?if_exists >${goods.goodsProperty}</#if>
                                    </script>
	                                <script type="text/javascript">
	                                	
	                                    //实例化编辑器
	                                    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor       ('editor')就能拿到相关的实例
	                                    var ueditorPro = UE.getEditor('goods_property');
	                                </script>
	                            </div>
	                            <p onClick="$('#leading').click();">添加附件 <span>(商品附件最大20M，支持格式：PDF、Word、Excel、Txt、JPG、PNG、BMP、GIF)</span></p>
	                            <input type="file" style="display: none" id="leading" name="file" onchange="changeName();"/>
	                            <span id="fileName" class="picName hide" onclick="deleteFile()"></span>
	                        </div>
	                        <div class="send-obj clearfix" style="margin-top: 20px;">
	                            <span class="fl" style="vertical-align: middle;margin-top: 8px;"><i>*</i>发送对象</span>
	                            <div class="select-box fl">
	                                <div class="fl">
	                                    <input type="text" readonly class="show" placeholder="客户类型,不选代表选择全部"/>
	                                    <input type="text" readonly class="hidden" name="customerTypeId"/>
	                                    <span>▼</span>
	                                    <ul class="hide">
	                                    	<c:forEach items="${customerTypeList}" var="customerType">
		                                        <li data-id="${customerType.id}">${customerType.type}</li>
	                                        </c:forEach>
	                                    </ul>
	                                </div>
	                            </div>
	                        </div>
	                        <div class="btn-block">
	                            <input type="submit" class="queren" value="确认"/>
	                            <input type="button" class="quxiao" value="取消"/>
	                        </div>
	                    </form>
	                </div>
	                
	                
	            </div>
	        </div>
	        <script src="${pageContext.request.contextPath}/static/orderlang/distributor/js/notice_list.js"></script>
	        <!--内容部分结束-->
	    </div>
	</div>
</body>
</html>